package protype;

import java.io.IOException;

public class Setup {
	public static void main(String[] args) throws CloneNotSupportedException, ClassNotFoundException, IOException {
		Product product = new Product();
		product.setInfoInt(1);
		product.setInfoStr("product");

		System.out.println(product);
		System.out.println("----------");

		simple(product);
		depth(product);
		
	}

	private static void simple(Product product) throws CloneNotSupportedException {
		Product product2 = (Product) product.clone();

		System.out.println(product);
		System.out.println(product2);
		System.out.println(product2 == product);
		System.out.println(product2.equals(product));
		System.out.println(product2.getInfoInt() == product.getInfoInt());
		System.out.println(product2.getInfoStr().equals(product.getInfoStr()));
		System.out.println(product2.getInfoStr() == product.getInfoStr());
		System.out.println("----------");

	}

	private static void depth(Product product) throws ClassNotFoundException, IOException {
		Product product3 = (Product) product.deepClone();

		System.out.println(product);
		System.out.println(product3);
		System.out.println(product3 == product);
		System.out.println(product3.equals(product));
		System.out.println(product3.getInfoInt() == product.getInfoInt());
		System.out.println(product3.getInfoStr().equals(product.getInfoStr()));
		System.out.println(product3.getInfoStr() == product.getInfoStr());
		System.out.println("----------");
	}

}
